package com.example.demo.config;

import com.example.demo.Student;
import com.example.demo.User;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

/**
 * @author zhuyc
 * @version 1.0
 * @description TODO
 * @date 2023/11/17 11:47
 */
@Configuration
public class DemoConfig {

	@Bean
	public User user(){
		User user=new User();
		user.setId(1);
		user.setName("zhuyc");
		Student student=student();
		System.out.println(student);
		user.setStudent(student);
		return user;
	}

	@Bean
	public Student student(){
		Student student=new Student();
		System.out.println(student+"=====2222");
		student.setAge(2);
		student.setName("zhuyc1");
		return student;
	}
}
